home *** CD-ROM | disk | FTP | other *** search
/ Mac OS on the PowerPC Mic…rocessor - In Store Demo / Mac OS on the PowerPC Microprocessor.iso / MacOS / MacOS.dxr / 00056_parent -change graphic-.ls < prev    next >
Encoding:
Text File  |  1996-05-13  |  11.0 KB  |  250 lines

  1. property selectedCastList, theFilePath, theIFTXT
  2. global gGraphicPath, gDelimiter, gFileName, gBookmark
  3.  
  4. on birth me
  5.   set theIFTXT to fileIOread(gGraphicPath & getProp(gFileName, #IFTXT))
  6.   return me
  7. end
  8.  
  9. on importGraphic me, external
  10.   global gBookmarkLoc, gIndexParagraphField, gBookmarkLoginText, gSoundLevel, setintime, stillDown, gPictTransition, gHelpChapter, gHelpParagraph, gchaptertextheight, glessonnumber, gChapterBtnLocList, gVolumeBtnLocList, gColor, gFieldTop, onIBM, gIntroPictRect, gIntroMovieRect, gSpriteSetList, gDoorLoc, gDoorOpen, gIntroText2, grectlist
  11.   if line 44 of theIFTXT = EMPTY then
  12.     set gBookmark to 0
  13.   else
  14.     set gBookmark to 1
  15.     set gBookmarkLoc to point(integer(item 2 of line 44 of theIFTXT), integer(item 3 of line 44 of theIFTXT))
  16.     set gIndexParagraphField to line 45 of theIFTXT
  17.     set gBookmarkLoginText to line 46 to 49 of theIFTXT
  18.   end if
  19.   if external = 0 then
  20.     set the colorDepth to integer(item 1 of line 2 of theIFTXT)
  21.   else
  22.     set the colorDepth to external
  23.   end if
  24.   importCast(me, "BACKGND.PCT")
  25.   importCast(me, "PLAY_UP.PCT")
  26.   importCast(me, "PLAY_DN.PCT")
  27.   importCast(me, "PAUSE_UP.PCT")
  28.   importCast(me, "PAUSE_DN.PCT")
  29.   importCast(me, "LEFT_UP.PCT")
  30.   importCast(me, "LEFT_DN.PCT")
  31.   importCast(me, "RIGHT_UP.PCT")
  32.   importCast(me, "RIGHT_DN.PCT")
  33.   importCast(me, "SLIDER.PCT")
  34.   importCast(me, "VOLUME.PCT")
  35.   importCast(me, "INDEX_UP.PCT")
  36.   importCast(me, "INDEX_DN.PCT")
  37.   importCast(me, "MENU_UP.PCT")
  38.   importCast(me, "MENU_DN.PCT")
  39.   importCast(me, "QUIT_UP.PCT")
  40.   importCast(me, "QUIT_DN.PCT")
  41.   importCast(me, "HELP_UP.PCT")
  42.   importCast(me, "HELP_DN.PCT")
  43.   importCast(me, "INDEXBKG.PCT")
  44.   importCast(me, "RETURNUP.PCT")
  45.   importCast(me, "RETURNDN.PCT")
  46.   if integer(item 3 of line 2 of theIFTXT) = 0 then
  47.     set theDoor to 0
  48.   else
  49.     set theDoor to 1
  50.     importCast(me, "DOORB_UP.PCT")
  51.     importCast(me, "DOORB_DN.PCT")
  52.     importCast(me, "DOOR.PCT")
  53.   end if
  54.   set gSoundLevel to integer(item 2 of line 2 of theIFTXT)
  55.   set the soundLevel to gSoundLevel
  56.   set the puppet of sprite 47 to 1
  57.   set the rect of sprite 47 to rect(0, 0, 640, 480)
  58.   set the foreColor of sprite 47 to integer(item 4 of line 2 of theIFTXT)
  59.   if integer(item 5 of line 2 of theIFTXT) then
  60.     set gIntroPictRect to item 3 to 6 of line 5 of theIFTXT
  61.   else
  62.     set gIntroPictRect to EMPTY
  63.   end if
  64.   if integer(item 6 of line 2 of theIFTXT) then
  65.     set gIntroMovieRect to item 3 to 6 of line 6 of theIFTXT
  66.   else
  67.     set gIntroMovieRect to EMPTY
  68.   end if
  69.   set gPictTransition to integer(item 7 of line 2 of theIFTXT)
  70.   set gHelpChapter to integer(item 8 of line 2 of theIFTXT)
  71.   if voidp(gHelpChapter) then
  72.     set gHelpChapter to 1
  73.   end if
  74.   set gHelpParagraph to integer(item 9 of line 2 of theIFTXT)
  75.   if voidp(gHelpParagraph) then
  76.     set gHelpParagraph to 1
  77.   end if
  78.   set the textFont of cast 32 to returnFont(item 1 of line 3 of theIFTXT)
  79.   set the textSize of cast 32 to integer(item 2 of line 3 of theIFTXT)
  80.   set the textHeight of cast 32 to integer(item 3 of line 3 of theIFTXT)
  81.   set gchaptertextheight to integer(item 3 of line 3 of theIFTXT)
  82.   set the textStyle of cast 32 to item 4 of line 3 of theIFTXT
  83.   set the textFont of cast 33 to returnFont(item 1 of line 4 of theIFTXT)
  84.   set the textSize of cast 33 to integer(item 2 of line 4 of theIFTXT)
  85.   set the textHeight of cast 33 to integer(item 3 of line 4 of theIFTXT)
  86.   set the textStyle of cast 33 to item 4 of line 4 of theIFTXT
  87.   set gColor to []
  88.   setSpriteRect(me, 7)
  89.   set theRect to BoxToRect(item 3 to 6 of line 8 of theIFTXT)
  90.   set the puppet of sprite 7 to 1
  91.   set the rect of sprite 7 to theRect
  92.   set the puppet of sprite 8 to 1
  93.   set the rect of sprite 8 to theRect
  94.   set theTextRect to BoxToRect(item 3 to 6 of line 10 of theIFTXT)
  95.   setAt(theTextRect, 4, getAt(theTextRect, 2) + (gchaptertextheight * glessonnumber) + (gchaptertextheight / 2))
  96.   set the puppet of sprite 9 to 1
  97.   set the rect of cast 32 to theTextRect
  98.   set the rect of sprite 9 to theTextRect
  99.   if (getAt(theTextRect, 3) - getAt(theTextRect, 1)) > (getAt(theRect, 3) - getAt(theRect, 1)) then
  100.     setAt(theTextRect, 4, getAt(theTextRect, 2) + (gchaptertextheight * glessonnumber))
  101.     set the puppet of sprite 6 to 1
  102.     set the rect of sprite 6 to theTextRect
  103.     set gFieldTop to getAt(theTextRect, 2) - gchaptertextheight
  104.   else
  105.     setAt(theRect, 4, getAt(theRect, 2) + (gchaptertextheight * glessonnumber))
  106.     set the puppet of sprite 6 to 1
  107.     set the rect of sprite 6 to theRect
  108.     set gFieldTop to getAt(theRect, 2) - gchaptertextheight
  109.   end if
  110.   setSpriteRect(me, 11)
  111.   setSpriteRect(me, 12)
  112.   setSpriteRect(me, 13)
  113.   setSpriteRect(me, 14)
  114.   setSpriteRect(me, 15)
  115.   set theRect to BoxToRect(item 3 to 6 of line 16 of theIFTXT)
  116.   set the puppet of sprite 15 to 1
  117.   set the rect of cast 33 to theRect
  118.   set the rect of sprite 15 to theRect
  119.   setSpriteRect(me, 17)
  120.   setSpriteRect(me, 18)
  121.   setSpriteRect(me, 19)
  122.   setSpriteRect(me, 20)
  123.   set gSpriteSetList to []
  124.   add(gSpriteSetList, [47, 48])
  125.   if theDoor then
  126.     set gDoorLoc to []
  127.     set gDoorOpen to 0
  128.     setSpriteRect(me, 21)
  129.     setSpriteRect(me, 22)
  130.     set DoorLoc to item 3 to 9 of line 33 of theIFTXT
  131.     if item 8 of DoorLoc = EMPTY then
  132.       set firstH to integer(item 1 of DoorLoc)
  133.       set firstV to integer(item 2 of DoorLoc)
  134.       set stepH to integer(item 3 of DoorLoc)
  135.       set stepV to integer(item 4 of DoorLoc)
  136.       set step to integer(item 5 of DoorLoc)
  137.       repeat with m = 0 to step
  138.         append(gDoorLoc, point(firstH + (stepH * m), firstV + (stepV * m)))
  139.       end repeat
  140.     else
  141.       set firstH to integer(item 1 of DoorLoc)
  142.       set firstV to integer(item 2 of DoorLoc)
  143.       set lastH to integer(item 6 of DoorLoc)
  144.       set lastV to integer(item 7 of DoorLoc)
  145.       set step to integer(item 5 of DoorLoc)
  146.       set stepH to float(lastH - firstH) / step
  147.       set stepV to float(lastV - firstV) / step
  148.       repeat with m = 0 to step - 1
  149.         append(gDoorLoc, point(integer(firstH + (stepH * m)), integer(firstV + (stepV * m))))
  150.       end repeat
  151.       append(gDoorLoc, point(lastH, lastV))
  152.     end if
  153.     if gBookmark then
  154.       add(gSpriteSetList, [1, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 23, 24])
  155.     else
  156.       add(gSpriteSetList, [1, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 24])
  157.     end if
  158.   else
  159.     if gBookmark then
  160.       add(gSpriteSetList, [1, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 23, 24])
  161.     else
  162.       add(gSpriteSetList, [1, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 24])
  163.     end if
  164.   end if
  165.   set the puppet of sprite 24 to 1
  166.   set the rect of sprite 24 to BoxToRect(item 3 to 6 of line 24 of theIFTXT)
  167.   set the puppet of sprite 26 to 1
  168.   set the rect of sprite 26 to BoxToRect(item 3 to 6 of line 25 of theIFTXT)
  169.   setSpriteRect(me, 26)
  170.   setSpriteRect(me, 27)
  171.   set bigrect to item 3 to 6 of line 28 of theIFTXT
  172.   set mediumrect to item 3 to 6 of line 29 of theIFTXT
  173.   set smallrect to item 3 to 6 of line 30 of theIFTXT
  174.   set soundrect to item 3 to 6 of line 30 of theIFTXT
  175.   set gChapterBtnLocList to BoxToRect(item 3 to 6 of line 31 of theIFTXT)
  176.   set gVolumeBtnLocList to BoxToRect(item 3 to 6 of line 32 of theIFTXT)
  177.   set the ink of sprite 8 to 32
  178.   set the blend of sprite 8 to integer(item 3 of line 34 of theIFTXT)
  179.   set the foreColor of sprite 7 to integer(item 2 of line 35 of theIFTXT)
  180.   set the foreColor of sprite 8 to integer(item 3 of line 35 of theIFTXT)
  181.   add(gColor, returnRGB(integer(item 3 of line 37 of theIFTXT)))
  182.   add(gColor, returnRGB(integer(item 5 of line 38 of theIFTXT)))
  183.   add(gColor, returnRGB(integer(item 3 of line 36 of theIFTXT)))
  184.   add(gColor, returnRGB(integer(item 2 of line 39 of theIFTXT)))
  185.   add(gColor, returnRGB(integer(item 3 of line 39 of theIFTXT)))
  186.   add(gColor, returnRGB(integer(item 4 of line 39 of theIFTXT)))
  187.   add(gColor, integer(item 5 of line 39 of theIFTXT))
  188.   add(gColor, integer(item 6 of line 39 of theIFTXT))
  189.   set the foreColor of cast 32 to getAt(gColor, 1)
  190.   set the foreColor of cast 33 to getAt(gColor, 3)
  191.   set the foreColor of cast 35 to getAt(gColor, 6)
  192.   set the foreColor of cast 34 to getAt(gColor, 4)
  193.   set the puppet of sprite 29 to 1
  194.   set the foreColor of sprite 29 to getAt(gColor, 7)
  195.   set the rect of sprite 29 to rect(492, 107, 615, 119)
  196.   set the puppet of sprite 30 to 1
  197.   set the foreColor of sprite 30 to getAt(gColor, 8)
  198.   set the rect of sprite 30 to rect(500, 108, 517, 117)
  199.   set the puppet of sprite 31 to 1
  200.   set the foreColor of sprite 31 to getAt(gColor, 8)
  201.   set the rect of sprite 31 to rect(500, 385, 517, 394)
  202.   set the puppet of sprite 37 to 1
  203.   set the rect of sprite 37 to rect(492, 107, 615, 395)
  204.   set the textFont of cast 34 to returnFont(item 7 of line 39 of theIFTXT)
  205.   set the textFont of cast 35 to returnFont(item 7 of line 39 of theIFTXT)
  206.   set the textSize of cast 34 to integer(item 8 of line 39 of theIFTXT)
  207.   set the textSize of cast 35 to integer(item 8 of line 39 of theIFTXT)
  208.   set the textHeight of cast 34 to integer(item 9 of line 39 of theIFTXT)
  209.   set the textHeight of cast 35 to integer(item 9 of line 39 of theIFTXT)
  210.   set the textStyle of cast 34 to item 10 of line 39 of theIFTXT
  211.   set the textStyle of cast 35 to item 10 of line 39 of theIFTXT
  212.   set the text of cast 37 to item 2 of line 40 of theIFTXT
  213.   set gIntroText2 to item 2 of line 41 of theIFTXT
  214.   set the foreColor of cast 37 to returnRGB(integer(item 3 of line 42 of theIFTXT))
  215.   set the textFont of cast 37 to returnFont(item 4 of line 42 of theIFTXT)
  216.   set the textSize of cast 37 to integer(item 5 of line 42 of theIFTXT)
  217.   set the textHeight of cast 37 to integer(item 6 of line 42 of theIFTXT)
  218.   set the textStyle of cast 37 to item 7 of line 42 of theIFTXT
  219.   set theRect to BoxToRect(item 8 to 11 of line 42 of theIFTXT)
  220.   set the rect of cast 37 to theRect
  221.   set the puppet of sprite 48 to 1
  222.   set the loc of sprite 48 to point(getAt(theRect, 1), getAt(theRect, 2))
  223.   if line 43 of theIFTXT <> EMPTY then
  224.     set the backColor of cast 86 to returnRGB(integer(item 2 of line 43 of theIFTXT))
  225.     set the foreColor of cast 86 to returnRGB(integer(item 3 of line 43 of theIFTXT))
  226.     set the textFont of cast 86 to returnFont(item 4 of line 43 of theIFTXT)
  227.     set the textSize of cast 86 to integer(item 5 of line 43 of theIFTXT)
  228.     set the textHeight of cast 86 to integer(item 6 of line 43 of theIFTXT)
  229.     set the textStyle of cast 86 to item 7 of line 43 of theIFTXT
  230.     set theRect to BoxToRect(item 8 to 11 of line 43 of theIFTXT)
  231.     setAt(theRect, 3, getAt(theRect, 3) - 16)
  232.     set the rect of cast 86 to theRect
  233.     set the puppet of sprite 22 to 1
  234.     set the loc of sprite 22 to point(getAt(theRect, 1), getAt(theRect, 2))
  235.   end if
  236.   set grectlist to [bigrect, mediumrect, smallrect, soundrect]
  237. end
  238.  
  239. on setSpriteRect me, n
  240.   set spritenum to integer(item 2 of line n of theIFTXT)
  241.   set the puppet of sprite spritenum to 1
  242.   set the rect of sprite spritenum to BoxToRect(item 3 to 6 of line n of theIFTXT)
  243. end
  244.  
  245. on importCast me, thepictname
  246.   set thecastno to the number of cast thepictname
  247.   importFileInto(cast thecastno, gGraphicPath & thepictname)
  248.   set the regPoint of cast thecastno to point(the width of cast thecastno / 2, the height of cast thecastno / 2)
  249. end
  250.